import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'lucide:area-chart',
      order: 2,
      title: $t('page.welfare.title'),
    },
    name: 'Welfare',
    path: '/welfare',
    children: [
      {
        name: 'welfareList',
        path: '/welfare/index',
        component: () => import('#/views/welfare/index.vue'),
        meta: {
          title: $t('page.welfare.list'),
        },
      },
      {
        name: 'WelfareDetail',
        path: '/welfare/detail/:id',
        component: () => import('#/views/welfare/detail.vue'),
        meta: {
          activePath: '/welfare',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.welfare.detail'),
        },
      },
      {
        name: 'WelfareEdit',
        path: '/welfare/edit/:id',
        component: () => import('#/views/welfare/edit.vue'),
        meta: {
          activePath: '/welfare',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.welfare.edit'),
        },
      },
      {
        name: 'WelfareReceive',
        path: '/welfare/receive/:id',
        component: () => import('#/views/welfare/receive.vue'),
        meta: {
          affixTab: true,
          title: $t('page.welfare.receive'),
        },
      },
      {
        name: 'WelfareCreate',
        path: '/welfare/create',
        component: () => import('#/views/welfare/create.vue'),
        meta: {
          activePath: '/welfare',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.welfare.create'),
        },
      },
    ],
  },
];

export default routes;
